package com.acme.task1;

public class Calculator {
	public static void main(String[] args) {
		if( args.length<3 ){
			System.out.println("Args Number error!");
			return;
		} else {
			calculate(args);
		}
	}
	static void calculate(final String[] arr){
		Double arg1 = Double.parseDouble(arr[0]);
		char operation = arr[1].charAt(0);
		Double arg2 = Double.parseDouble(arr[2]);
		Double result;
		switch(operation){
			case '+':
				result = arg1 + arg2;
				break;
			case '-':
				result = arg1 + arg2;
				break;
			case '*':
				result = arg1 * arg2;
				break;
			case '/':
				result = arg1 / arg2;
				break;
			default:
				System.out.println("Operation def error!");
				return;
		}
		System.out.println(result);
	}
}
